<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
<!--
$(function(){
	//初始化表单验证
	$("#editForm").validate({
		rules:{
			phonenumber: {
				isMobile:true
			}
		},
		messages:{
			trueName: {required: "请输入真实姓名"},
			phonenumber: {required: "请输入手机号码",isMobile: "请输入正确的手机号码"}
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					case -1:
						Kit.alert("网络繁忙...，请重试");return;
					case 0:
						onEditSuccess(data.object.id,data.object);
						editDialog.close();
					}
				}
			});
		}
	});
});
//-->
</script>
 <style type="text/css">
				.form-groups {
				    width: 45%;
				     margin-right: 15px; 
				    margin-left: 15px; 
				    margin-bottom: 15px;  
				}
				.col-lg-9s {
				    width: 65%;
				}
				.left{
					float:left;
				}
				.right{
					float:right;
				}
				.col-lgs{
					width: 35%;
					padding-right: 15px; 
				}
				.inp{
					text-indent:10px;
					height: 30px;
					width: 80%;
					border-radius:5px;
				}
				input[disabled],input:disabled{
					border:1px solid #DDD;
					background-color:#F5F5F5;
					color:#ACA899;
				}
				.tts{
					margin-right: 30px; 
				}
</style>

<form id="editForm" action="${BASE_PATH}/auth/admin/doEdit" method="post" class="form-horizontal" >
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">账号：</label>
		    <div class="col-lg-9s right">
	        	<input type="text" class="inp"  class="form-user" name="username" value="${object.username}" required maxlength="20" disabled="disabled" >
		    </div>
		</div>
		
		<div class="form-groups right">
		    <label class="col-lgs control-label left">真实姓名：</label>
		    <div class="col-lg-9s right">
	        	<input type="text" class="inp" name="trueName" id="" value="${object.trueName}" class="form-user" placeholder="请输入真实姓名" required maxlength="11"  >
		    	<input type="hidden" value="${object.trueName}" name="oldName">
		    </div>
		</div>
	</div>
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">员工性别：</label>
		    <div class="col-lg-9s right">
	        <select name="sex" class="selectpicker form-user">
				<option value="1" <c:if test="${object.sex==1}">data-dropdown-selected="true"</c:if>>男</option>
				<option value="0" <c:if test="${object.sex==0}">selected</c:if>>女</option>
	        </select>
		    </div>
		</div>
		<div class="form-groups right">
		    <label class="col-lgs control-label left">所属分公司：</label>
		     <c:if test="${roid==1}">
			    <div class="col-lg-9s right">
		        	 <select id="sStoreId" name="storeid" class="selectpicker form-user" data-width="80%" data-url="${BASE_PATH}/api/storeAll" data-isfirst="true" data-val="${store.storeid}" data-key="storeid:title"></select>  
			    </div>
		    </c:if>
		    <c:if test="${roid==2}">
			    <div class="col-lg-9s right">
		        	<select id="sStoreId" name="storeid"  class="selectpicker" data-width="80%" data-url="${BASE_PATH}/api/Orderstore/${sellerId}" data-isfirst="true" data-val="${store.storeid}"  data-key="storeid:title"></select> 
			    </div>
		    </c:if>
		    <c:if test="${roid==3}">
			    <div class="col-lg-9s right">
		        	    <input type="text" name="" value="${store.title}" class="form-user inp" placeholder="" disabled="disabled" maxlength="11">
		                <input type="hidden" name="storeid" value="${store.storeid}" class="form-user inp" placeholder="" maxlength="11">  
			    </div>
		    </c:if>
		</div>
	</div>
	<div class="row">
		<div class="form-groups left">
		    <label class="col-lgs control-label left">联系方式：</label>
		    <div class="col-lg-9s right">
	         <input type="text" class="form-user inp" name="phonenumber" value="${object.phonenumber}" class="form-control" placeholder="请输入手机号码" required maxlength="11" >
		    </div>
		</div>
	<!--  <div class="form-groups right">
		    <label class="col-lgs control-label left">员工ID：</label>
		    <div class="col-lg-9s right">
	        <input type="text" name="" value="" class="form-user"  >
		    </div>
		</div> -->
		<div class="form-groups right">
		    <label class="col-lgs control-label left">当前状态：</label>
		    <div class="col-lg-9s right">
	        <select name="enabled" class="selectpicker ">
				<option value="1" <c:if test="${object.enabled==1}">data-dropdown-selected="true"</c:if>>可用</option>
				<option value="0" <c:if test="${object.enabled==0}">selected</c:if>>禁用</option>
	        </select>
		    </div>
		</div>
	</div>
	<div class="row">
	   <div class="form-groups right">
		    <label class="col-lgs control-label left">会员管理：</label>
		    <div class="col-lg-9s right">
	        <select name="VipPower" class="selectpicker ">
		        <c:if test="${roid==1}">
		        	<option value="0" <c:if test="${object.VipPower==0}">data-dropdown-selected="true"</c:if>>禁用</option>
		        	<option value="1" <c:if test="${object.VipPower==1}">selected</c:if>>可用</option>
		        </c:if>
		        <c:if test="${roid==2 or roid==3}">
					<option value="0" <c:if test="${object.VipPower==0}">data-dropdown-selected="true"</c:if>>禁用</option>
					<c:if test="${VipPower==1}">
						<option value="1" <c:if test="${object.VipPower==1}">selected</c:if>>可用</option>
					</c:if>
		        </c:if>
	        </select>
		    </div>
		</div>
		<div class="form-groups left">
		    <label class="col-lgs control-label left">员工贡献分：</label>
		    <div class="col-lg-9s right">
	        	<input type="text" class="inp" name="contribution" id="" value="${object.contribution}" class="form-user" placeholder=""  maxlength="11"  >
		    </div>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" autocomplete="off">提交</button></div>
		<div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left" type="button" onclick="javascript:editDialog.close();" autocomplete="off">取消</button></div>
	</div>
	<input type="hidden" name="userid" value="${object.id}"/>
	<input type="hidden" name="Roid"  value="${roid}"/>  
</form>
